]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Only show add/remove favorite when shouldShowApp() is true
authorIan Douglas Scott <idscott@system76.com>
Fri, 30 Oct 2020 16:57:40 +0000 (09:57 -0700)
committerIan Douglas Scott <idscott@system76.com>
Fri, 30 Oct 2020 18:20:45 +0000 (11:20 -0700)
`shouldShowApp()` is called in `_addFavorite`, so adding a favorite when
this isn't true won't work. Also, it seems when this is false, favorites
that do exist won't be shown anyway.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3342

js/ui/appDisplay.js

index 64da2e636462269091b2bbc7d9ee7a61bf937df9..8e10de2d8f3d0f3dd8e9060dbf8117ad43b2baf1 100644 (file)
@@ -2883,6 +2883,8 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
 
         this._source = source;
 
+        this._parentalControlsManager = ParentalControlsManager.getDefault();
+
         this.actor.add_style_class_name('app-well-menu');
 
         // Chain our visibility and lifecycle to that of the source
@@ -2963,7 +2965,8 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
                 });
             }
 
-            let canFavorite = global.settings.is_writable('favorite-apps');
+            let canFavorite = global.settings.is_writable('favorite-apps') &&
+                              this._parentalControlsManager.shouldShowApp(this._source.app.app_info);
 
             if (canFavorite) {
                 this._appendSeparator();